Device-to-device (D2D for short) communication refers to direct communication between terminals without forwarding a signal by using a base station. A D2D technology can relieve a burden of a macro network and increase a communication rate between UEs.
In a discovery function of the D2D communication, a terminal needs to obtain a corresponding frequency-time resource from a resource pool to send a discovery signal. As shown in FIG. 1, assuming that a resource pool can be divided into three time intervals and 3 frequency bands in total, nine (3×3) frequency-time resources are generated altogether. The terminal selects one from the nine frequency-time resources to send a discovery signal of the terminal itself. There are nine terminals (numbered 1 to number 9) altogether, and each terminal occupies one frequency-time resource to send a discovery signal of the terminal itself.
During an implementation process of selecting the frequency-time resource by the terminal, the inventor finds that when a terminal selects a frequency-time resource, multiple terminals may select a same frequency-time resource, as shown in FIG. 2. A terminal 2 and a terminal 3 share one frequency-time resource. As a result, discovery signals sent by the multiple terminals that select the same frequency-time resource interfere with each other, and transmit quality of the discovery signals of the terminals is reduced.